OpenStack Grizzly - Set Floating IP
2013/08/13 |
It's possible to access to Virtual machine Instance to set Floating IP address.
|
|
[1] | Change Nova's setting first to assign Floating IP address automatically. |
[root@dlp ~(keystone)]#
vi /etc/nova/nova.conf # near line 26: add flat_network_bridge = br100
auto_assign_floating_ip = True [keystone_authtoken] /etc/rc.d/init.d/openstack-nova-network restart Stopping openstack-nova-network: [ OK ] Starting openstack-nova-network: [ OK ] |
[2] | Set Floating IP address. For exmaple, assign 10.0.0.248/29 for Floating IP addresses in internal network 10.0.0.0/24. |
[root@dlp ~(keystone)]# nova-manage floating create --ip_range=10.0.0.248/29 [root@dlp ~(keystone)]# nova-manage floating list None 10.0.0..249 None nova eth0 None 10.0.0..250 None nova eth0 None 10.0.0..251 None nova eth0 None 10.0.0..252 None nova eth0 None 10.0.0..253 None nova eth0 None 10.0.0..254 None nova eth0 |
[3] | Create a new instance and boot it, then Floating IP is assgined automatically like follows. In the example below, The "10.0.0.249" is just the Floating IP. |
# create and boot Instance [root@dlp ~(keystone)]# nova boot --flavor 3 --image d41846d5-c67c-49f2-a616-6c9a136bed3a --security_group default CentOS6_SRV [root@dlp ~(keystone)]# nova list +--------------------------------------+-------------+---------+--------------------------------+ | ID | Name | Status | Networks | +--------------------------------------+-------------+---------+--------------------------------+ | 96676b36-d13f-4f13-89ab-f269b3f28273 | CentOS6 | SHUTOFF | network01=10.1.0.2 | | 0a40e76c-fc0b-49a1-94c5-a610e93ff9c0 | CentOS6_SRV | ACTIVE | network01=10.1.0.3, 10.0.0.249 | +--------------------------------------+-------------+---------+--------------------------------+ |
[4] | The Instances created before setting Floating IP, Floating IP does not assigned automatically, so it necessarry to set it manually like follows. |
[root@dlp ~(keystone)]# nova list +--------------------------------------+-------------+---------+--------------------------------+ | ID | Name | Status | Networks | +--------------------------------------+-------------+---------+--------------------------------+ | 96676b36-d13f-4f13-89ab-f269b3f28273 | CentOS6 | SHUTOFF | network01=10.1.0.2 | | 0a40e76c-fc0b-49a1-94c5-a610e93ff9c0 | CentOS6_SRV | SHUTOFF | network01=10.1.0.3, 10.0.0.249 | +--------------------------------------+-------------+---------+--------------------------------+ # assign "10.0.0.250" to "CentOS6" [root@dlp ~(keystone)]# nova add-floating-ip CentOS6 10.0.0.250 [root@dlp ~(keystone)]# nova list +--------------------------------------+-------------+---------+--------------------------------+ | ID | Name | Status | Networks | +--------------------------------------+-------------+---------+--------------------------------+ | 96676b36-d13f-4f13-89ab-f269b3f28273 | CentOS6 | SHUTOFF | network01=10.1.0.2, 10.0.0.250 | | 0a40e76c-fc0b-49a1-94c5-a610e93ff9c0 | CentOS6_SRV | SHUTOFF | network01=10.1.0.3, 10.0.0.249 | +--------------------------------------+-------------+---------+--------------------------------+ |